include $(ACM_ROOT)/acm_config/mmacros.mk
include $(ACM_ROOT)/acm_config/mrules.mk

#--------------------------

USER_CPP_DEBUG = -g
LIBDIR = $(ACM_ROOT)/src/libs
OBJDIR = $(ACM_ROOT)/src/.objs
TOP_INCLUDE_DIR = $(ACM_ROOT)/src/include

#---------------------------------------------------------------------------
#
##  Dependencies rule
#
##  -MM outputs a rule suitable for make describing the dependencies. Header
#  files that are found in system header directories are not mentioned.
#  #
#  The purpose of the sed command is to make each .d file depnd on all the
#  #  source and header files that the corresponding .o file depends on.
#
##  To automatically generate dependencies, a makefile needs to include all
#  .d files corresponding to source ( C or C++ ).
#  #
#  A clean target will not cause dependencies to be generated.
#  #  -include will not complain if file not found
#
##  ifneq ($(MAKECMDGOALS),clean)
#  -include $(CXX_SRC:.cxx=.d)
#  #  -include $(C_SRC:.c=.d)
#  endif
#  #
%.d: %.cpp
	@echo "Generating dependency file $@... "
	@$(CCC) -MM $(CPPFLAGS) $< > $@.$$$$; \
	sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
	$(RM) $@.$$$$

%.d: %.cxx
	@echo "Generating dependency file $@... "
	@$(CCC) -MM $(CPPFLAGS) $< > $@.$$$$; \
	sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
	$(RM) $@.$$$$


%.d: %.c
	@echo "Generating dependency file $@... "
	@$(CCC) -MM $(CPPFLAGS) $< > $@.$$$$; \
	sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
	$(RM) $@.$$$$

#---------------------------------------------------------------------------

